package com.fc.advbox.entity;

import com.fc.advbox.utils.validator.group.AddGroup;
import com.fc.advbox.utils.validator.group.UpdateGroup;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 系统用户
 *
 * @author Charles
 */
@Getter
@Setter
public class AdvUserEntity implements Serializable {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 用户ID
	 */
	private Long id;

	/**
	 * 用户名
	 */
	@NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String name;

	private String type;

	/**
	 * 密码
	 */
	@NotBlank(message="密码不能为空", groups = AddGroup.class)
	private transient String password;

	private String nickName;

	/**
	 * 邮箱
	 */
	@NotBlank(message="邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
	private String email;

	/**
	 * 手机号
	 */
	@NotBlank(message="手机号码不能为空", groups = AddGroup.class)
	private String phone;

	/**
	 * 状态  0：禁用   1：正常
	 */
	private Integer status;

	/**
	 * 角色ID列表
	 */
	private List<Long> roleIdList;

	/**
	 * 创建时间
	 */
	private Date createTime;

	/**
	 * 更新时间
	 */
	private Date updateTime;
	/**
	 * 过期时间
	 */
	private Date expireTime;

	/**
	 * 头像
	 */
	private String avatar;

	/**
	 * 设备UUID
	 */
	private String deviceUUID;

	/**
	 * 微信OPEnID
	 */
	private String openId;

	/**
	 * 所属机构ID
	 */
	private Long orgId;

	/* 积分 */
	private Integer point;

	/* 用户所属*/
	private AdvOrgEntity organization;

	/* 用户所属组织的账号信息 */
	private AdvOrgAcctEntity orgAccount;

}
